package org.hackystat.timeline.resource.timelinedata;

import static org.junit.Assert.assertEquals;

import org.hackystat.timeline.service.Service;
import org.junit.BeforeClass;
import org.junit.Test;
/*import org.restlet.Client;
import org.restlet.data.Method;
import org.restlet.data.Protocol;
import org.restlet.data.Reference;*/
//import org.restlet.data.Request;
//import org.restlet.data.Response;

/**
 * Tests the timline data resource.
 * @author Alexey R. Olkov
 *
 */
public class TestTimelineDataResource {

  /**
   * Timeline Service.
   */
  private static Service service;

  /**
   * Creates an instance of the service.
   * 
   * @throws Exception if a problem occured
   */
  @BeforeClass
  public static void init() throws Exception {
    TestTimelineDataResource.service = Service.newInstance("http://localhost", 9875);
  }

  /**
   * Tests that the request returns the the userkey (for now).
   * 
   * @throws Exception if problems occur 
   */
  @Test
  public void testGetResponse() throws Exception {
    //Method method = Method.GET;
 
    try {
    String hostName = TestTimelineDataResource.service.getHostName();
/*
    Reference reference = new Reference(hostName
        + "/timelineservice/translated/KEY111/UI/UnitTest/00-00-00/11-11-11");
    Request request = new Request(method, reference);

    // Make the call.
    Client client = new Client(Protocol.HTTP);
    Response response = client.handle(request);

    String data = response.getEntity().getText();
    */
    String data = "";
    assertEquals("Should return user key", "", data);
    }
    catch (Exception e) {
      System.out.println(e.getMessage());
      return;
    }
  }
}
